package sktit.practice.jpaint.canvas;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import sktit.practice.jpaint.shape.Shape;

public class AbstractCanvas implements Canvas {

	protected GC gc;
	protected Shape shape;
	
	public AbstractCanvas(GC aGC, Shape aShape)
	{
		gc = aGC;
		shape = aShape;
	}
	
	public void draw()
	{
	}
	
	public void drawBorder()
	{
		Point[] border = shape.getBorder();
		gc.setLineStyle(SWT.LINE_DASHDOT);
		for(int i = 0; i < border.length - 1; i++)
			gc.drawLine(border[i].x, border[i].y, border[i+1].x, border[i+1].y);
		gc.drawLine(border[0].x, border[0].y, border[border.length - 1].x, border[border.length - 1].y);
	}
	
	public void fill(Color color)
	{
	}
	
}
